/*******************************************************************************
 * Copyright © 2010 Hewlett-Packard Development Company, L.P.
 *            All rights reserved.
 ******************************************************************************/

package com.tnl.domain.enums;

/**
 * the permission enum
 * 
 * @author haigang
 */
public enum PermissionEnums {
	
	//Module permissions
	USER_VIEW("user_view", "Allow to to view user module"),
	PROJECT_VIEW("project_view", "Allow to to view project module"),
	REPORT_VIEW("report_view", "Allow to to view report module"),
	VM_VIEW("vm_view", "Allow to to view vm lifecycle module"),
	
	//Project permissions
	CREATE_PROJECT("create_project", "Permission to create a new project"),
	UPDATE_PROJECT("update_project", "Permission to update a existing project"),
	CLOSE_PROJECT("close_project", "Permission to close a project"),
	
	//Virtual Machine permissions
	CREATE_VM("create_vm", "Permission to create a new virtual machine"),
	UPDATE_VM("update_vm", "Permission to update a existing virtual machine"),
	DELETE_VM("delete_vm", "Permission to delete a virtual machine"),
	POWERON_VM("poweron_vm", "Permission to power on a virtual machine"),
	POWEROFF_VM("poweroff_vm", "Permission to power off a virtual machine"),
	SUSPEND_VM("suspend_vm", "Permission to suspend a virtual machine"),
	RESET_VM("reset_vm", "Permission to reset a virtual machine");
	
	private String name;
	private String desc;

	PermissionEnums(String name, String description) {
		this.name = name;
		this.desc = description;
	}



	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}



	/**
	 * @return the desc
	 */
	public String getDesc() {
		return desc;
	}



	@Override
	public String toString() {
		return name + ". " + desc;
	}

}
